<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>

<head>
  <meta charset="UTF-8">
  <title>资讯详情页</title>
  <meta name="page-view-size" content="1280*720">
  <link rel="stylesheet" href="../css/base.css">
  <link rel="stylesheet" href="../css/teamDetail.css">
  <script type="text/javascript" src="../lib/js/evm.js"></script>
  <script type="text/javascript" src="../lib/js/Evm_djyw.js"></script>
  <script type="text/javascript" src="../lib/js/key.js"></script>
  <script src="../lib/js/jquery-1.11.1.min.js" type="text/javascript" charset="utf-8"></script>
  <script src="../lib/js/jquery.cookie.js" type="text/javascript" charset="utf-8"></script>
  <script src="../js/api.js" type="text/javascript" charset="utf-8"></script>
  <script src="../js/public.js" type="text/javascript" charset="utf-8"></script>
  <script src="../js/video.js"></script>
  <script>
    marqueerun = false
  </script>
  <style>
    .author {
      color: #EF5645;
    }
  </style>
</head>

<body>
  <div class="articleDetail-bg" id="articleDetailMain">

    <div id="articleDetailBody">
      <div class="title"></div>
      <!-- <div class="time"></div> -->
      <div class="author"></div>
      <!-- <div class="view"></div>
            <div class="likeNumber"></div> -->
      <div class="model" id="modelImg">
        <img class="imgs" src="" alt="">
        <!-- <div class="alearts">点击可全屏并切换</div> -->
        <!-- <div class='confirm'>确定</div> -->
      </div>
      <div class="model" id="detailContain">
        <div class="container" id="detail">
          团队要求：
          <div class="content" id="content">
          </div>
        </div>
        <div class="join" id="join">申 请</div>
      </div>
      <!-- <div class="model" id="like">
              点赞
            </div> -->
      <!-- <div class="model" id='collection'>
        收藏
      </div> -->
      <div class="share-border">
        <div class="share-img"><img src="" alt=""></div>
        <div class="left-label">扫码分享</div>
      </div>
      <div class="detailMsg">
        <div class="detailRow">
          <div class="detailName">联 系 人：</div>
          <div class="detailTxt  contacter"></div>
        </div>
        <div class="detailRow">
          <div class="detailName">联系方式：</div>
          <div class="detailTxt phone"></div>
        </div>
        <!-- <div class="detailRow">
                    <div class="detailName">团队人数：</div>
                    <div class="detailTxt num"></div>
                  </div> -->
        <!-- <div class="detailRow">
                  <div class="detailName">开始时间：</div>
                  <div class="detailTxt startTime">
        
                  </div>
                </div>
                <div class="detailRow">
                    <div class="detailName">结束时间：</div>
                    <div class="detailTxt endTime">
          
                    </div>
                </div> -->
        <div class="detailRow">
          <div class="detailName">活动地址：</div>
          <div class="detailTxt address">

          </div>
        </div>
        <!-- <div class="detailRow">
          <div class="detailName">所属区域：</div>
          <div class="detailTxt address">

          </div>
        </div> -->
        <div class="detailRow">
          <div class="detailName">发布时间：</div>
          <div class="detailTxt fabutime">

          </div>
        </div>
      </div>
    </div>
</body>
<script>
  var modelIndex = {
    disUser: true,
    //isVideo: true,
    index: 1, //初始位置
    listName: 'model', //模块名称
    containerId: 'articleDetailBody', //包含模块的标签id
    thisContain: 'detailContain', //翻滚外容器
    thisDetail: 'detail', //翻滚内容
  }

  var articleRun;
  var photos;

  function direOpt(index, directive) {
    // if (directive == "up") {//上
    //     if (index == 1) {//文章翻滚
    //         TV.articleMove(directive, modelIndex.thisContain, modelIndex.thisDetail);
    //     }else if(index == 2 || index == 3) {
    //         index = 0;
    //     }
    // } else if (directive == "down") {//下
    //     if (index == 1) {//文章翻滚
    //         TV.articleMove(directive, modelIndex.thisContain, modelIndex.thisDetail);
    //     }else if(index == 0) {
    //         index = 2;
    //     }
    // } else if(directive == 'forwards') {
    //     if(index == 0){
    //       index = 1
    //     }else if(index == 1 ){
    //       index  ++
    //     }
    //     clearInterval(articleRun);
    // } else if(directive == 'backwards'){
    //   if(index == 1){
    //     index = 0
    //   }else if (index == 2 || index == 3){
    //     index --;
    //   }
    //   clearInterval(articleRun);
    // }
    return 1;
  }

  function getMessage() {
    var param = {
      id: TV.GetParam('id'),
      
      // area_id: $.cookie('TV_CST_AREA')
    }
    GetDatas('volunteerGroup', param, function (err, res) {
      var mess = res.data;
      console.log(mess)
      photos = mess.logo;

      $('.fabutime').html(mess.addtime.slice(0, 10));
      $('.content').text(mess.condition);
      $('.title').html(mess.title)
      $('.time').html(mess.format_start_time)
      $('.author').html(mess.group_name)
      $('.view').html(mess.click_count)
      $('.likeNumber').html(mess.likes)
      // $('#collection').remove()
      $('.contacter').html(mess.master)
      $('.num').html(mess.bm_count)
      $('.startTime').html(mess.format_start_time)
      $('.endTime').html(mess.format_end_time)
      $('.phone').html(mess.mobile)
      $('.address').html(mess.address)
      if (mess.logo) {
        $('.imgs').attr('src', API_URL['imgURL'] + mess.logo);
      } else {
        $('.imgs').attr('src', '../images/base.png');
      }
      if (mess.status == 3) {
        $('.join').html('已结束')
        $('#join').addClass('unable');
      }

      var surl = API_URL.loginURL + "home/index/qrcode?url=" + encodeURIComponent(API_URL.wxshareJoinTeam + TV.GetParam(
        'id'));
      $('.share-img>img').attr('src', surl);


    })
  }
  getMessage();

  function direEnter(index) {
    if (index == 0 && photos && photos.length) {
      // alert('0')
      // window.location.href = './carrousel.html?id=' + TV.GetParam('id');
    } else if (index == 1) {
      // clearInterval(articleRun);
      // alert('1')
      var access_token = $.cookie('TV_CST_TOKEN');
      var param = {
        group_id: TV.GetParam('id'),
        token: access_token,
      }
      GetDatas('joinGroup', param, function (err, res) {
        console.log(res)
        if (res.code == 0) {
          TV.PromptMsg('已确认申请')
        } else if (res.code == 401) {
          var message = res.message
          TV.PromptMsg(message)
          setTimeout(function () {
            window.location.href = './login.html';
          }, 2500)
        } else {
          var message = res.message
          TV.PromptMsg(message)
        }
      })
    } else if (index == 2) {
      // alert('2')
    }
  }
</script>
<script type="text/javascript" src="../js/index.js"></script>

</html>